Scroll Progress Bar

Datatypes

It is a keyword which specifies what type of constants can be stared in a variable.

Datatype
Format Specifier
int %d
float %f
char %c
Example:

    int a;
    float b; 
    char p;    

Whenever users declare variables, space is reserved in the memory. By default, it contains an unpredictable value known as garbage value.

Initialization Statement:-

To avoid garbage values and to assign any desired values which declaring a variables user can use this statement

Syntax: datatype var1=vl1 [, var2=val2, …];
Assignment statement: (calculations)

It is used to assign a constant, value of variable, result of an expression into another variable.

Syntax: var = expr;
Example:

    a=79;
    b=-35;
    z=x+y
    x=y;

What data type is used for integers in C?


int

What data type is used for single-precision floating-point numbers in C?


float

What data type is used for double-precision floating-point numbers in C?


double

What data type is used for characters in C?


char

What data type is used for storing true or false values in C?


bool